﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using ViewMaker;
using ViewMaker.Core;
using ViewMaker.Core.Controls;

namespace CloudStorageLight.WpfClient
{
    /// <summary>
    /// フォルダ作成ViewModel
    /// </summary>
    [View(typeof(CreateDirectoryWindow))]
    public class CreateDirectoryVM : ViewModelBase
    {

        public string FolderName
        {
            get { return _FolderName; }
            set { _FolderName = value; OnPropertyChanged("FolderName", "CanOK"); }
        }
        private string _FolderName;

        public bool DialogResult { get; set; }

        public double FontSize { get; set; }

        public bool CanOK { get { return !string.IsNullOrWhiteSpace(FolderName); } }

        public ICommand OKCommand { get { return CreateCommand(OK); } }
        private void OK()
        {
            DialogResult = true;
            this.ExecuteViewCommand(ViewCommands.Close);
        }

        public ICommand CloseCommand { get { return CreateCommand(Close); } }
        private void Close()
        {
            this.FolderName = null;
            this.ExecuteViewCommand(ViewCommands.Close);
        }

    }
}
